﻿using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace ProjectMyFarmAndShe
{
    [Serializable]
    public class SpriteData
    {
        public string Key;
        public Sprite Icon;
    }

    [CreateAssetMenu(fileName = "SpriteSO", menuName = "Game/SpriteSO")]
    public class SpriteSO : ScriptableObject
    {
        public List<SpriteData> AllSpriteData = new List<SpriteData>();

        public Sprite GetSpriteByKey(string key)
        {
            return AllSpriteData.Single(data => data.Key == key).Icon;
        }
    }
}